home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / callback.001 / callback~ / callback / lib / ttyline / getactivetty.c < prev    next >
C/C++ Source or Header  |  1996-07-22  |  515b  |  18 lines

  1.  
  2. #include "ttyline.p"
  3.  
  4. char *get_active_tty()
  5. {       
  6.     if (active_index == n_lines)        /* at the end of the set */
  7.     {
  8.         reset_active_tty();
  9.         return (NULL);                      
  10.     }
  11.     
  12.     if (active_line == -1)              /* all lines are active */
  13.         return (ttyline[active_index++]);/* return line, upgrade to next */
  14.         
  15.     active_index = n_lines;             /* one line: next call returns NULL */
  16.  
  17.     return (ttyline[active_line]);      /* return the active line */
  18. }